﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ue.Infrastructure.DomainBase;
using Ue.Qcdz.Domain.Shops;

namespace Ue.Qcdz.Domain.SaleInfos
{
    public class SaleInfo : EntityBase
    {
        public SaleInfo(object key):base(key)
        {
        }
        public SaleInfo(string userId, SaleInfoEnum salesType, string salteTitle, string keyWord, PeriodDate period, string directory, string brand, string model, string description, string picUrl, IsTopEnum isTop, IsHotEnum isHot, string shopId, string saleCategory, DateTime deadline, object key)
            : base(key)
        {
            UserId = userId;
            SalesType = salesType;
            SalteTitle = salteTitle;
            KeyWord = keyWord;
            Period = period;
            Directory = directory;
            Brand = brand;
            Model = model;
            IsTop = isTop;
            IsHot = isHot;
            Description = description;
            ShopId = shopId;
            PicUrl = picUrl;
            SaleCategoryId = saleCategory;
            Deadline = deadline;
            shop=new Shop();
        }

        public string SaleCategoryId { get; set; }
        public string UserId { get; set; }
        public SaleInfoEnum SalesType { get; set; }
        public string SalteTitle { get; set; }
        public string KeyWord { get; set; }
        public PeriodDate Period { get; set; }
        public string Directory { get; set; }
        public string Brand { get; set; }
        public string Model { get; set; }
        public string Description { get; set; }
        public string PicUrl { get; set; }
        public IsTopEnum IsTop { get; set; }
        public IsHotEnum IsHot { get; set; }
        public string ShopId { get; set; }
        public Shop shop { get; set; }
        public DateTime Deadline { get; set; }
        public void ChangeIsHot()
        {
            if (this.IsHot == IsHotEnum.No)
                this.IsHot = IsHotEnum.Yes;
            else
            {
                this.IsHot = IsHotEnum.No;
            }
        }
        public void ChangeIsTop()
        {
            if (this.IsTop == IsTopEnum.No)
                this.IsTop = IsTopEnum.Yes;
            else
            {
                this.IsTop = IsTopEnum.No;
            }
        }
    }
}
